package ch.mueller.android.sensorexample.sensorpages.gpssensor.util.readerFactoryElements;

import java.util.LinkedHashMap;

public class GLLAnalyser extends GPSLineAnalyser {

    public GLLAnalyser(String line) {
        super(line);
    }

    @Override
    public LinkedHashMap<String, String> getResult() {
        LinkedHashMap<String, String> element = new LinkedHashMap<String, String>();
        int i = 0;
        String[] splitts = line.split(",");
        element.put("TYPE", getValue(splitts, i++));
        element.put("Latitude", getValue(splitts, i++));
        element.put("NS/Indicator", nsCkeck(getValue(splitts, i++)));
        element.put("Longitude", getValue(splitts, i++));
        element.put("E/W Indicator", owCkeck(getValue(splitts, i++)));
        element.put("UTC Time", UTCtimeCheck(getValue(splitts, i++)));
        element.put("Status", avStatusCheck(getValue(splitts, i++)));
        element.put(CHECKSUM, calculateCheksum(line));
        return element;
    }

}